
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/index?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">消耗品价格列表</a>
                </li>
                <li>
                    <a href="#" onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/form?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">消耗品价格添加</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchPriceForm" modelAttribute="expPrice"  onsubmit="return loadDivForm('priceRightDiv','searchPriceForm','${ctx}/csm/expPrice/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>消耗品代码 ：</label><form:input path="expInfo.expDict.expCode" htmlEscape="false" maxlength="50" class="form-control" />
                                    &nbsp;&nbsp;<label>消耗品名称 ：</label><form:input path="expInfo.expDict.expName" htmlEscape="false" maxlength="50" class="form-control" />
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                    <th hidden>infoId</th>
                                    <th>代码</th>
                                    <th>品名</th>
                                    <th>规格</th>
                                    <th>单位</th>
                                    <th>厂家</th>
                                    <th>批发价/元</th>
                                    <th>零售价/元</th>
                                    <th>起用日期</th>
                                 <%--   <th>费用分类</th>
                                    <th>核算项目分类</th>
                                    <th>会计科目</th>
                                    <th>病案首页分类</th>--%>
                                    <th>最高限价/元</th>
                                    <th>停价时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="expPrice" varStatus="stopPrice">
                                <tr id="stopTr${stopPrice.index}">
                                    <td hidden> ${expPrice.expInfo.id}</td>
                                    <td> ${expPrice.expInfo.expDict.expCode}</td>
                                    <td> ${expPrice.expInfo.expDict.expName}</td>
                                    <td> ${expPrice.packageSpec}</td>
                                    <td> ${fns:getDictLabels(expPrice.units, 'SPEC_UNIT', '')}</td>
                                    <td> ${expPrice.expInfo.expSupplierCata.supplierName}</td>
                                    <td> ${expPrice.tradePrice}</td>
                                    <td> ${expPrice.retailPrice}</td>
                                    <td> <fmt:formatDate value="${expPrice.startDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                 <%--   <td> ${fns:getDictLabels(expPrice.classOnRcpt, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.classOnReckoning, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.subjCode, 'TALLY_SUBJECT_DICT', '')}</td>
                                    <td> ${expPrice.classOnMr}</td>--%>
                                    <td> ${expPrice.priceMax}</td>
                                    <td> ${expPrice.stopDate}</td>
                                    <td>
                                        <a href="#" onclick="basePrice('确认要生成消耗品的基本价格吗？','priceRightDiv','${ctx}/csm/expPrice/basicPrice?id=${expPrice.id}','${ctx}/csm/expPrice/index?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')" class="btn btn-primary btn-xs">生成基本价格</a>
                                       <%-- <a href="#" onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/form?id=${expPrice.id}')" class="btn btn-success btn-xs">修改</a>--%>
                                        <a href="#" class="btn btn-danger btn-xs" id="stopA${stopPrice.index}" onclick="basePrice('您确认要停用该消耗品吗？','priceRightDiv','${ctx}/csm/expPrice/stopPrice?id=${expPrice.id}',
                                                '${ctx}/csm/expPrice/index?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">停价</a>
                                    </td>
                                </tr>
                            <script>
                                    if('${expPrice.stopDate}'!=''){
                                        $("#stopA${stopPrice.index}").css("display","none");
                                        $("#stopTr${stopPrice.index}").css("backgroundColor","#CAD4CF");
                                    }
                            </script>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>